package org.example.common.codec;

import com.alibaba.fastjson2.JSON;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.example.common.dispacher.Message;

/**
 * @title
 * @time 2025/6/17 0:21
 */
@Data
@NoArgsConstructor
public class Invocation implements Message {
    /**
     * 类型
     */
    private String type;
    /**
     * 消息，JSON 格式
     */
    private String message;

    public Invocation(String type, Message message) {
        this.type = type;
        this.message = JSON.toJSONString(message);
    }

    public Invocation(String type, String message) {
        this.type = type;
        this.message = message;
    }
}
